/*     */ package com.newcrm.webapi;
/*     */ 
/*     */ import com.newcrm.bean.User;
/*     */ import com.newcrm.db.UserVOIPManager;
/*     */ import com.newcrm.exception.NotFoundException;
/*     */ import com.newcrm.util.ParameterUtil;
/*     */ import com.newcrm.webapi.sub.VOIPAgentReport;
/*     */ import com.newcrm.webapi.sub.VOIPDialoutAreaReport;
/*     */ import java.io.IOException;
/*     */ import java.util.List;
/*     */ import javax.servlet.RequestDispatcher;
/*     */ import javax.servlet.ServletException;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class VOIPReport extends AbstractHttpServlet
/*     */ {
/*     */   private static final long serialVersionUID = -3319495317900801777L;
/*     */ 
/*     */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/*  56 */     if (!checkLogin(request)) {
/*  57 */       super.showLoginPage(request, response);
/*  58 */       return;
/*     */     }
/*  60 */     String url = request.getRequestURI();
/*     */ 
/*  62 */     String[] param = ParameterUtil.getParameters(url, getTagkey());
/*  63 */     User user = super.getLoginUser(request);
/*     */ 
/*  65 */     if ((!user.isAdmin) && (!user.isGroupAdmin)) {
/*  66 */       request.getRequestDispatcher("/nopermission.jsp").forward(
/*  67 */         request, response);
/*  68 */       return;
/*     */     }
/*     */ 
/*  71 */     if ((param == null) || (param.length == 0))
/*     */     {
/*  73 */       UserVOIPManager manager = new UserVOIPManager();
/*  74 */       List items = manager
/*  75 */         .getUsersVOIPInfos(user.companyId);
/*  76 */       request.setAttribute("seats", items);
/*  77 */       request.getRequestDispatcher("/voip_report.jsp").forward(request, 
/*  78 */         response);
/*  79 */       return;
/*     */     }
/*     */     try {
/*  82 */       if (param.length == 1) {
/*  83 */         if ("dialoutArea".equals(param[0])) {
/*  84 */           new VOIPDialoutAreaReport(this).parse(request, response);
/*  85 */           return;
/*     */         }
/*     */ 
/*  88 */         if ("agent".equals(param[0])) {
/*  89 */           new VOIPAgentReport(this).parse(request, response);
/*  90 */           return;
/*     */         }
/*     */       }
/*     */     }
/*     */     catch (NotFoundException e) {
/*  95 */       request.getRequestDispatcher("/nopermission.jsp").forward(
/*  96 */         request, response);
/*  97 */       return;
/*     */     }
/*  99 */     super.doGet(request, response);
/*     */   }
/*     */ 
/*     */   protected String getTagkey()
/*     */   {
/* 104 */     return "/voipReport";
/*     */   }
/*     */ 
/*     */   protected AbstractAction getAddAction()
/*     */   {
/* 109 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getListAction()
/*     */   {
/* 114 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAddPageAction()
/*     */   {
/* 119 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getUpdateAction(String id)
/*     */   {
/* 124 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowConfirmDestroyAction(String id)
/*     */   {
/* 129 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getDeleteAction(String id)
/*     */   {
/* 134 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAction(String id)
/*     */   {
/* 139 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowUpdatePageAction(String id)
/*     */   {
/* 144 */     return null;
/*     */   }
/*     */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.VOIPReport
 * JD-Core Version:    0.6.1
 */